@import "../../assets/styles/variables.scss";

.category-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  background-color: #f5f5f5;
}

// 搜索栏样式
.search-bar {
  background-color: #FFEB3B; // 黄色背景
  padding: 10px 15px;
  position: relative;
  z-index: 1;

  .search-input {
    background-color: #fff;
    height: 56px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;

    .search-placeholder {
      color: #999;
      font-size: 32px;
    }
  }

  .category-tabs {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    
    .tab {
      flex: 1;
      text-align: center;
      margin: 0;
      padding: 5px 0;
      font-size: 32px;
      position: relative;
      color: #333;
      display: flex;
      justify-content: center;
      align-items: center;
      
      &.active {
        color: #000;
        font-weight: bold;
        
        &:after {
          content: '';
          position: absolute;
          bottom: 0;
          left: 20%;
          right: 20%;
          height: 2px;
          background-color: #000;
        }
      }
    }
  }
}

// 主分类横向区域
.main-categories-horizontal {
  width: 100%;
  background-color: #fff;
  padding: 10px 0;
  border-bottom: 1px solid #eee;
  overflow-x: auto;
}
.main-categories-list {
  display: flex;
  flex-direction: row;
  align-items: center;
  padding: 0 8px;
}
.category-item-horizontal {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  margin: 0 12px;
  cursor: pointer;
}
.category-item-horizontal.active {
  border-bottom: 3px solid #ff6b00;
  background: none;
}
.category-item-horizontal .category-icon,
.category-item-horizontal .category-icon-placeholder {
  width: 130px;
  height: 130px;
  margin-bottom: 6px;
  border-radius: 50%;
  background: #f7f7f7;
  object-fit: cover;
  box-shadow: 0 2px 8px #eee;
  border: 1.5px solid #f5f5f5;
  font-size: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.category-item-horizontal .category-name-horizontal {
  font-size: 15px;
  color: #333;
  text-align: center;
  font-weight: 700;
  letter-spacing: 1px;
}

// 子分类纵向区域
.sub-categories-vertical {
  flex: 1;
  background-color: #fff;
  height: 100%;
  overflow-y: auto;
}
.sub-category-wrapper-vertical {
  padding: 10px 0 0 0;
}
.sub-tabs-vertical {
  display: flex;
  flex-direction: column;
  border-right: 1px solid #eee;
  width: 100px;
  min-height: 300px;
}
.sub-tab-vertical {
  padding: 12px 0;
  margin: 0 0 2px 0;
  background-color: #f5f5f5;
  border-radius: 0 15px 15px 0;
  text-align: center;
  cursor: pointer;
}
.sub-tab-vertical.active {
  background-color: #ffe9cf;
  color: #ff6b00;
}
.sub-tab-name-vertical {
  font-size: 14px;
  writing-mode: vertical-rl;
  letter-spacing: 2px;
}

// 主内容区域
.content-container {
  display: flex;
  flex: 1;
  overflow: hidden;

  // 左侧主分类区域
  .main-categories {
    width: 90px;
    background-color: #f8f8f8;
    height: 100%;

    .category-item {
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      padding: 15px 5px;
      border-bottom: 1px solid #eee;
      
      &.active {
        background-color: #fff;
        border-left: 3px solid #ff6b00;
      }

      .category-icon, .category-icon-placeholder {
        width: 40px;
        height: 40px;
        margin-bottom: 5px;
      }

      .category-icon-placeholder {
        background-color: #ddd;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        
        .icon-text {
          font-size: 16px;
          color: #555;
        }
      }

      .category-name {
        font-size: 12px;
        color: #333;
        text-align: center;
      }
    }
  }

  // 右侧子分类区域
  .sub-categories {
    flex: 1;
    background-color: #fff;
    height: 100%;

    .sub-category-wrapper {
      padding: 10px;

      .sub-tabs {
        display: flex;
        flex-wrap: wrap;
        border-bottom: 1px solid #eee;
        padding-bottom: 10px;
        
        .sub-tab {
          padding: 5px 10px;
          margin: 3px;
          background-color: #f5f5f5;
          border-radius: 15px;
          
          &.active {
            background-color: #ffe9cf;
            color: #ff6b00;
          }
          
          .sub-tab-name {
            font-size: 12px;
          }
        }
      }

      .empty-content {
        display: flex;
        align-items: center;
        justify-content: center;
        height: 200px;
        
        .empty-text {
          color: #999;
          font-size: 14px;
        }
      }
    }
  }
}

.main-category-bar {
  width: 100%;
  background: #fff;
  display: flex;
  justify-content: center;
  align-items: center;
  border-bottom: 1px solid #eee;
  padding: 18px 0 18px 0;
  margin: 0;
}
.main-category-bar .category-grid {
  width: 100%;
  padding: 0;
  margin: 0;
  justify-content: stretch;
}
.main-category-bar .category-grid__item {
  flex: 1 1 0;
  max-width: 25%;
  min-width: 0;
  margin: 0;
}
.main-category-bar .category-grid__item.active {
  background: #fffbe9;
  color: #ff6b00;
  font-weight: 900;
  box-shadow: 0 2px 8px #ffe9cf;
  border-bottom: 3px solid #ff6b00;
  border-radius: 16px 16px 0 0;
}
.main-category-bar .category-grid__text {
  color: #333;
  font-weight: 700;
  transition: color 0.2s;
}
.main-category-bar .category-grid__item.active .category-grid__text {
  color: #ff6b00;
}

.content-area {
  display: flex;
  flex-direction: row;
  height: calc(100vh - 200px); /* 头部+主分类高度预估 */
  background: #fff;
}

.sub-category-bar {
  width: 170px;
  background: #f8f8f8;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  border-right: 1px solid #eee;
  padding-top: 10px;
}
.sub-category-item {
  padding: 18px 0;
  text-align: center;
  cursor: pointer;
  background: none;
  transition: background 0.2s;
}
.sub-category-item.active {
  background: #fffbe9;
  color: #ff6b00;
  font-weight: bold;
}
.sub-category-text {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 2px;
}

.main-content {
  flex: 1;
  display: block;
  min-height: 300px;
}
.empty-text {
  color: #999;
  font-size: 16px;
}

.product-list {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 12px;
  justify-content: flex-start;
  align-items: flex-start;
  width: 100%;
  padding: 18px 8px;
  box-sizing: border-box;
}
.product-card {
  width: calc(50% - 12px);
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 12px #f5f5f5;
  margin-bottom: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #f2f2f2;
}
.product-img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  border-radius: 12px 12px 0 0;
  background: #f8f8f8;
}
.product-info {
  padding: 10px 12px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.product-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.product-title {
  font-size: 32px;
  font-weight: 700;
  color: #222;
}
.product-tag-wrap {
  display: block;
  margin: 0 0 8px 0;
}
.product-tag-inner {
  font-size: 24px;
  color: #fff;
  background: #ffb300;
  border-radius: 8px;
  padding: 4px 16px;
  display: inline-block;
}
.product-desc {
  font-size: 26px;
  color: #888;
  margin: 8px 0 0 0;
}
.product-price {
  font-size: 32px;
  color: #ff6b00;
  font-weight: bold;
  margin-top: 12px;
} 